ActionController::Routing::Routes.draw do |map|
  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
  map.login  '/login', :controller => 'sessions', :action => 'new'
  
  map.connect "/activate/:activation_code", :controller=>'users', :action=>'activate'
  map.simple_captcha '/simple_captcha/:action', :controller => 'simple_captcha' 
  
  map.root :controller => "welcome"
  
  map.resource  :session
  
  map.resources :users, :member=>{:recover=>:get, :restore=>:post}, :collection=>{:forget=>:post}
  map.resources :pages, :only=>[:show]
  map.resources :posts
  map.resources :services
  map.resources :photos
  map.resources :coaches
	map.resource :search
  
  map.namespace :manage, {:path_prefix=>"manage"} do |manage|
		manage.resources :users, :member=>{:activate=>:post, :suspend=>:post, :delete=>:post, :unsuspend=>:post}
		manage.resources :structures, :has_many=>[:posts, :photos], :has_one=>[:page]
    manage.resources :settings
    manage.resources :picture
    manage.resources :services
		manage.resources :coaches
	end
	map.connect '/manage', :controller=>"manage/structures"
  
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
